package base.exa17;

public class IndexOfStudy {
    public static void main(String[] args) {
        String tom="I am a good \n \\n \\ cat";
        int a,b,c,d,e;
        a=tom.indexOf("I");
        b=tom.indexOf("a");
        c=tom.indexOf("good",2);
        d=tom.indexOf("good",8);
        e = tom.lastIndexOf("a");
        System.out.println("a: "+a);
        System.out.println("b: "+b);
        System.out.println("c: "+c);
        System.out.println("d: "+d);
        System.out.println("a lastIndexOf:"+ e);
        System.out.println(tom);
    }
}
